package com.homedo.microservice.open.service.gateway.bean.po.enhanced;

import com.homedo.common.dao.bean.po.enhanced.base.BaseEnhanced;
import com.homedo.microservice.open.service.gateway.bean.enums.forroutedomain.StatusEnum4RouteDomain;
import com.homedo.microservice.open.service.gateway.bean.po.RouteDomain;
import org.springframework.beans.BeanUtils;

/**
 * @author 作者 jgshun
 * @date 创建时间 2018年09月18日 11时30分20秒
 */
public class RouteDomainEnhanced extends BaseEnhanced {
    public RouteDomainEnhanced(RouteDomain routeDomain) {

        BeanUtils.copyProperties(routeDomain, this);

        //自动生成 细微误差自己调整

        if (routeDomain.getStatus() != null) {
            this.status = StatusEnum4RouteDomain
                    .getStatusEnumByCode(routeDomain.getStatus().shortValue());
        }
    }

    public RouteDomainEnhanced() {
    }

    private java.lang.Integer id;
    private java.lang.String applicationName;
    private java.lang.String domain;
    private StatusEnum4RouteDomain status;
    private java.util.Date createTime;
    private java.util.Date updateTime;
    private java.lang.String comment;

    public java.lang.Integer getId() {
        return id;
    }

    public void setId(java.lang.Integer id) {
        this.id = id;
    }

    public java.lang.String getApplicationName() {
        return applicationName;
    }

    public void setApplicationName(java.lang.String applicationName) {
        this.applicationName = applicationName;
    }

    public java.lang.String getDomain() {
        return domain;
    }

    public void setDomain(java.lang.String domain) {
        this.domain = domain;
    }

    public StatusEnum4RouteDomain getStatus() {
        return status;
    }

    public void setStatus(StatusEnum4RouteDomain status) {
        this.status = status;
    }

    public java.util.Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(java.util.Date createTime) {
        this.createTime = createTime;
    }

    public java.util.Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(java.util.Date updateTime) {
        this.updateTime = updateTime;
    }

    public java.lang.String getComment() {
        return comment;
    }

    public void setComment(java.lang.String comment) {
        this.comment = comment;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        RouteDomainEnhanced that = (RouteDomainEnhanced) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (applicationName != null ? !applicationName.equals(that.applicationName) : that.applicationName != null)
            return false;
        if (domain != null ? !domain.equals(that.domain) : that.domain != null) return false;
        return status == that.status;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (applicationName != null ? applicationName.hashCode() : 0);
        result = 31 * result + (domain != null ? domain.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        return result;
    }
}